{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {
    "collapsed": true,
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "from selenium import webdriver\n",
    "import time\n",
    "from time import sleep\n",
    "import random\n",
    "from selenium.webdriver.common.action_chains import ActionChains\n",
    "from selenium.webdriver.common.keys import Keys\n",
    "user = 'meilyxiao'\n",
    "passwd = 'dfst5088'\n",
    "\n",
    "browser = webdriver.Firefox()\n",
    "# option = webdriver.ChromeOptions()\n",
    "# option.add_argument('--user-agent=iphone')\n",
    "# browser = webdriver.Chrome(chrome_options=option)\n",
    "# help(webdriver.Chrome)\n",
    "# options.addExtensions(new File(\"C:\\\\Users\\\\swang\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\UserData\\\\Default\\\\Extensions\\\\ijaobnmmgonppmablhldddpfmgpklbfh\\\\1.6.0_0.crx\"));/\n",
    "# browser = webdriver.Chrome(executable_path='C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe')\n",
    "# url = 'https://www.taobao.com/'\n",
    "# time.sleep(2)\n",
    "# browser.get(url)\n",
    "# browser = webdriver.PhantomJS(executable_path='E:\\\\Workspace\\\\Python_packages\\\\phantomjs-2.1.1-windows\\\\bin\\\\phantomjs.exe')\n",
    "url = \"https://login.taobao.com/member/login.jhtml?style=mini&from=alimama\"\n",
    "browser.get(url)\n",
    "sleep(1)\n",
    "for i in range(1):\n",
    "    sleep(3)\n",
    "    browser.find_element_by_xpath('//*[@name=\"TPL_username\"]').clear()\n",
    "    sleep(3)\n",
    "    browser.find_element_by_xpath('//*[@name=\"TPL_username\"]').click()\n",
    "    sleep(3)\n",
    "    browser.find_element_by_xpath('//*[@name=\"TPL_username\"]').send_keys(user)\n",
    "    sleep(3)\n",
    "#     browser.find_element_by_xpath('//*[@name=\"TPL_username\"]').send_keys(Keys.F5)\n",
    "#     sleep(3)\n",
    "    \n",
    "browser.find_element_by_xpath('//*[@name=\"TPL_password\"]').click()\n",
    "sleep(1)\n",
    "browser.find_element_by_xpath('//*[@name=\"TPL_password\"]').send_keys(passwd)\n",
    "sleep(1)\n",
    "# browser.find_element_by_id(\"submit-btn\").click()\n",
    "\n",
    "\n",
    "# browser.get_cookies()\n",
    "# time.sleep(3)\n",
    "# browser.delete_all_cookies()\n",
    "# time.sleep(3)\n",
    "# browser.add_cookie({'name':'1','value':'2','domain':'.taobao.com','path':'/'})\n",
    "# time.sleep(1)\n",
    "# browser.get_cookies()\n",
    "# url2 = \"https://www.taobao.com\"\n",
    "\n",
    "# time.sleep(3)\n",
    "# browser.find_element_by_id(\"TPL_username_1\").click()\n",
    "# for i in user:\n",
    "#     time.sleep(random.choice([0.2,0.3,0.4,0.5]))\n",
    "#     browser.find_element_by_id(\"TPL_username_1\").send_keys(u\"%s\"%i)\n",
    "# browser.find_element_by_id(\"TPL_password_1\").click()\n",
    "# time.sleep(0.5)\n",
    "# browser.find_element_by_id(\"TPL_username_1\").send_keys('123')\n",
    "# time.sleep(0.5)\n",
    "# browser.find_element_by_id(\"TPL_username_1\").click()\n",
    "# time.sleep(0.6)\n",
    "# action = ActionChains(browser)\n",
    "# e = browser.find_element_by_id(\"nc_1_n1z\")\n",
    "# hold = action.click_and_hold(e)\n",
    "# hold.move_by_offset(400, 0).release().perform()\n",
    "\n",
    "# browser.find_element_by_id(\"TPL_password_1\").click()\n",
    "# time.sleep(0.7)\n",
    "# browser.find_element_by_id(\"TPL_username_1\").click()\n",
    "# time.sleep(0.8)\n",
    "# browser.find_element_by_id(\"TPL_password_1\").click()\n",
    "\n",
    "\n",
    "\n",
    "e = browser.find_element_by_id(\"nc_1_n1z\")\n",
    "# 坐标\n",
    "x = e.location['x']\n",
    "y = e.location['y']\n",
    "action = ActionChains(browser)\n",
    "# 抓住滑块\n",
    "action.click_and_hold(on_element=e)\n",
    "time.sleep(1)\n",
    "# 移动滑块\n",
    "a = 1\n",
    "b = 5\n",
    "try:\n",
    "    for i in range(70):\n",
    "        b += 5\n",
    "        if i <= 35:\n",
    "            a += 1\n",
    "            action.move_to_element_with_offset(to_element=e, xoffset=b, yoffset=a)\n",
    "        else:\n",
    "            a -= 1 \n",
    "            action.move_to_element_with_offset(to_element=e, xoffset=b, yoffset=a)\n",
    "    time.sleep(0.2)\n",
    "    # 释放滑块\n",
    "    action.perform().release(to_element=e)\n",
    "except:\n",
    "    pass\n",
    "\n",
    "# browser.close()\n",
    "# time.sleep(3)\n",
    "# browser.find_element_by_id(\"TPL_password_1\").send_keys(passwd)\n",
    "time.sleep(0.3)\n",
    "browser.find_element_by_id(\"J_SubmitStatic\").click()\n",
    "url = 'http://shop.m.taobao.com/shop/coupon.htm?seller_id=2455092411&activity_id=b45e2ad4c6a04a9f8b4e4cc44e52e64d'\n",
    "browser.get(url)\n",
    "\n",
    "# type(location['x'])\n",
    "# help(ActionChains(browser).release)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'%3F'"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import urllib2\n",
    "keyword = (urllib2.quote('https://detail.tmall.com/item.htm?id=53469231530'))\n",
    "url = \"http://pub.alimama.com/promo/search/index.htm?q=%s&_t=1492754532887\" % keyword\n",
    "url = urllib2.quote('?')\n",
    "url"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<type 'str'>\n",
      "<type 'list'>\n"
     ]
    }
   ],
   "source": [
    "d = \"[{'domain': '.alimama.com', 'secure': False, 'value': 'U+CFER9F1jsCAd5PTeujSzm', 'expiry': 1808463197, 'path': '/', 'httpOnly': False, 'name': 'cna'}, {'domain': '.alimama.com', 'name': 'cookie31', 'value': 'MTEyMDIxMjc2LHhteWFuZGF5dSx5ZHlAZG9mYXN0LmNvbS5jbixUQg%3D%3D', 'path': '/', 'httpOnly': False, 'secure': False}, {'domain': '.alimama.com', 'name': 'cookie2', 'value': '2093139efefaa1d7fa95ba6c057e0a7d', 'path': '/', 'httpOnly': True, 'secure': False}, {'domain': '.alimama.com', 'secure': False, 'value': '852e38ec089ce00d9745c2054a68f90c', 'expiry': 1800689594.838825, 'path': '/', 'httpOnly': False, 'name': 't'}, {'domain': '.alimama.com', 'secure': False, 'value': 'ApOTxX79H1QSwAq0YR0HnCuqox29SCcK', 'expiry': 1896134400, 'path': '/', 'httpOnly': False, 'name': 'l'}, {'domain': '.alimama.com', 'name': '_tb_token_', 'value': 'hbiSczdpZZq', 'path': '/', 'httpOnly': False, 'secure': False}, {'domain': '.alimama.com', 'name': 'v', 'value': '0', 'path': '/', 'httpOnly': False, 'secure': False}, {'domain': '.alimama.com', 'name': 'login', 'value': 'Vq8l%2BKCLz3%2F65A%3D%3D', 'path': '/', 'httpOnly': False, 'secure': False}, {'domain': '.alimama.com', 'name': 'cookie32', 'value': 'fbba75510e5034ab1db0451021f395b1', 'path': '/', 'httpOnly': False, 'secure': False}, {'domain': '.alimama.com', 'secure': False, 'value': 'Ajo6UbW4NkuSgrqnhv7W_eefi2AETb7F4TVmlEQz5k2YN9pxLHsO1QDE8XQQ', 'expiry': 1508655197, 'path': '/', 'httpOnly': False, 'name': 'isg'}, {'domain': '.alimama.com', 'name': 'alimamapw', 'value': 'TAtIU1kBVk0WOAIHBQUCWFVRBAQEBQ5XVFJTUgEFUgJWCFVXUlIAVlIH', 'path': '/', 'httpOnly': True, 'secure': False}, {'domain': '.alimama.com', 'name': 'alimamapwag', 'value': 'TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV09XNjQpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS80OS4wLjI2MjMuMTEwIFNhZmFyaS81MzcuMzY%3D', 'path': '/', 'httpOnly': True, 'secure': False}, {'domain': 'www.alimama.com', 'name': 'apush14f80c039d6bd42f3d4e35b80b501fd1', 'value': '%7B%22ts%22%3A1493103198599%2C%22parentId%22%3A1493103198592%7D', 'path': '/', 'httpOnly': False, 'secure': False}]\"\n",
    "print type(d)\n",
    "\n",
    "import json\n",
    "d = eval(d)\n",
    "print type(d)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'dbcd'"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "str1 = 'abcd'\n",
    "str1 = str1.replace('a','d')\n",
    "str1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import os\n",
    "os.system('C:\\Windows\\System32\\cmd.exe')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[]\n",
      "[{u'domain': u'.m.taobao.com', u'name': u'cookie31', u'value': u'Njg4NjkyNDAsbWVpbHl4aWFvLDI5MzM0Mjc2QHFxLmNvbSxUQg%3D%3D', u'path': u'/', u'httpOnly': False, u'secure': False}, {u'domain': u'.m.taobao.com', u'name': u'cookie2', u'value': u'38c0c0e1b324ea14b9f41dd8b95ea4dd', u'path': u'/', u'httpOnly': False, u'secure': False}, {u'domain': u'.m.taobao.com', u'name': u't', u'value': u'7e83907f321349bbd0c7ea4493a5851d', u'path': u'/', u'httpOnly': False, u'secure': False}, {u'domain': u'.m.taobao.com', u'name': u'_tb_token_', u'value': u'3n6D1u14Q6bq', u'path': u'/', u'httpOnly': False, u'secure': False}, {u'domain': u'.m.taobao.com', u'name': u'v', u'value': u'0', u'path': u'/', u'httpOnly': False, u'secure': False}, {u'domain': u'.m.taobao.com', u'name': u'login', u'value': u'W5iHLLyFOGW7aA%3D%3D', u'path': u'/', u'httpOnly': False, u'secure': False}, {u'domain': u'.m.taobao.com', u'name': u'cookie32', u'value': u'952c9fd643ed13cea5c39990efc48139', u'path': u'/', u'httpOnly': False, u'secure': False}, {u'domain': u'.m.taobao.com', u'name': u'alimamapw', u'value': u'DFwKDxwcUQQOOAVTU1FTBwQHUVtWVFxWWwNRUgZRBFYHVwQBBw1SBwAG', u'path': u'/', u'httpOnly': False, u'secure': False}, {u'domain': u'.m.taobao.com', u'name': u'alimamapwag', u'value': u'TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV09XNjQ7IHJ2OjUzLjApIEdlY2tvLzIwMTAwMTAxIEZpcmVmb3gvNTMuMA%3D%3D', u'path': u'/', u'httpOnly': False, u'secure': False}]\n"
     ]
    },
    {
     "ename": "WebDriverException",
     "evalue": "Message: chrome not reachable\n  (Session info: chrome=58.0.3029.81)\n  (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10586 x86_64)\n",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mWebDriverException\u001b[0m                        Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-62-5c5368d97d7e>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m     32\u001b[0m \u001b[0mbrowser\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0murl\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     33\u001b[0m \u001b[0mtime\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msleep\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m5\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 34\u001b[1;33m \u001b[0mbrowser\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0murl\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32md:\\python27\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.pyc\u001b[0m in \u001b[0;36mget\u001b[1;34m(self, url)\u001b[0m\n\u001b[0;32m    259\u001b[0m         \u001b[0mLoads\u001b[0m \u001b[0ma\u001b[0m \u001b[0mweb\u001b[0m \u001b[0mpage\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mcurrent\u001b[0m \u001b[0mbrowser\u001b[0m \u001b[0msession\u001b[0m\u001b[1;33m.\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    260\u001b[0m         \"\"\"\n\u001b[1;32m--> 261\u001b[1;33m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexecute\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mCommand\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mGET\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m{\u001b[0m\u001b[1;34m'url'\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0murl\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    262\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    263\u001b[0m     \u001b[1;33m@\u001b[0m\u001b[0mproperty\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32md:\\python27\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.pyc\u001b[0m in \u001b[0;36mexecute\u001b[1;34m(self, driver_command, params)\u001b[0m\n\u001b[0;32m    247\u001b[0m         \u001b[0mresponse\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcommand_executor\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexecute\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdriver_command\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mparams\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    248\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mresponse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 249\u001b[1;33m             \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0merror_handler\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcheck_response\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mresponse\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    250\u001b[0m             response['value'] = self._unwrap_value(\n\u001b[0;32m    251\u001b[0m                 response.get('value', None))\n",
      "\u001b[1;32md:\\python27\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.pyc\u001b[0m in \u001b[0;36mcheck_response\u001b[1;34m(self, response)\u001b[0m\n\u001b[0;32m    191\u001b[0m         \u001b[1;32melif\u001b[0m \u001b[0mexception_class\u001b[0m \u001b[1;33m==\u001b[0m \u001b[0mUnexpectedAlertPresentException\u001b[0m \u001b[1;32mand\u001b[0m \u001b[1;34m'alert'\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    192\u001b[0m             \u001b[1;32mraise\u001b[0m \u001b[0mexception_class\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mmessage\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mscreen\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mstacktrace\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'alert'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'text'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 193\u001b[1;33m         \u001b[1;32mraise\u001b[0m \u001b[0mexception_class\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mmessage\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mscreen\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mstacktrace\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    194\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    195\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0m_value_or_default\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mobj\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdefault\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mWebDriverException\u001b[0m: Message: chrome not reachable\n  (Session info: chrome=58.0.3029.81)\n  (Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 10.0.10586 x86_64)\n"
     ]
    }
   ],
   "source": [
    "from selenium import webdriver\n",
    "import time\n",
    "from time import sleep\n",
    "import random\n",
    "from selenium.webdriver.common.action_chains import ActionChains\n",
    "from selenium.webdriver.common.keys import Keys\n",
    "\n",
    "\n",
    "# browser = webdriver.Firefox()\n",
    "# option = webdriver.ChromeOptions()\n",
    "# option.add_argument('--user-agent=iphone')\n",
    "browser = webdriver.Chrome()\n",
    "# help(webdriver.Chrome)\n",
    "# options.addExtensions(new File(\"C:\\\\Users\\\\swang\\\\AppData\\\\Local\\\\Google\\\\Chrome\\\\UserData\\\\Default\\\\Extensions\\\\ijaobnmmgonppmablhldddpfmgpklbfh\\\\1.6.0_0.crx\"));/\n",
    "# browser = webdriver.Chrome(executable_path='C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe')\n",
    "# url = 'https://www.taobao.com/'\n",
    "# time.sleep(2)\n",
    "# browser.get(url)\n",
    "# browser = webdriver.PhantomJS(executable_path='E:\\\\Workspace\\\\Python_packages\\\\phantomjs-2.1.1-windows\\\\bin\\\\phantomjs.exe')\n",
    "cookies_str = 'cookie2@@@38c0c0e1b324ea14b9f41dd8b95ea4dd;_tb_token_@@@3n6D1u14Q6bq;t@@@7e83907f321349bbd0c7ea4493a5851d;v@@@0;cookie32@@@952c9fd643ed13cea5c39990efc48139;cookie31@@@Njg4NjkyNDAsbWVpbHl4aWFvLDI5MzM0Mjc2QHFxLmNvbSxUQg%3D%3D;alimamapwag@@@TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV09XNjQ7IHJ2OjUzLjApIEdlY2tvLzIwMTAwMTAxIEZpcmVmb3gvNTMuMA%3D%3D;login@@@W5iHLLyFOGW7aA%3D%3D;alimamapw@@@DFwKDxwcUQQOOAVTU1FTBwQHUVtWVFxWWwNRUgZRBFYHVwQBBw1SBwAG'\n",
    "url = \"http://m.taobao.com\"\n",
    "browser.get(url)\n",
    "sleep(1)\n",
    "browser.delete_all_cookies()\n",
    "print browser.get_cookies()\n",
    "for cookies in cookies_str.split(';'):\n",
    "    name,value = cookies.split('@@@')\n",
    "    browser.add_cookie({'name':name,'value':value,'domain':'m.taobao.com'})\n",
    "sleep(1)\n",
    "print browser.get_cookies()\n",
    "url = 'http://shop.m.taobao.com/shop/coupon.htm?seller_id=2455092411&activity_id=b45e2ad4c6a04a9f8b4e4cc44e52e64d'\n",
    "browser.get(url)\n",
    "time.sleep(5)\n",
    "browser.get(url)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
